<template>
	<view>
		<view class="top"></view>
		<view class="formBox">
			<view class="maintenanceInfo">
				<view class="text">维修信息</view>
				<view class="infoFlex">
					<view class="uni-input-text">维修单号：</view>
					<view class="">
						{{formData.mid}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">维修状态：</view>
					<view class="">
						{{formData.status}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">车主姓名：</view>
					<view class="">
						{{formData.username}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">联系方式：</view>
					<view class="formData">
						{{formData.phone}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">维修方式：</view>
					<view class="">
						{{formData.method}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">取车位置：</view>
					<view class="">
						{{formData.carAddress}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">预约日期：</view>
					<view class="">
						{{formData.reservateTime}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">提交日期：</view>
					<view class="">
						{{formData.submitTime}}
					</view>
				</view>

			</view>

			<view class="carInfo">
				<view class="text">车辆信息</view>
				<view class="infoFlex">
					<view class="uni-input-text">车辆类型：</view>
					<view class="">
						{{formData.type}}
					</view>
				</view>
				<view class="infoFlex">
					<view class="uni-input-text">车牌号：</view>
					<view class="">
						{{formData.carId}}
					</view>
				</view>
				<view class="picture">
					<view class="uni-input-text">整车照片：</view>
					<view class="">
						<image src="/static/my/组 4.png" mode=""></image>
					</view>
				</view>
				<view class="picture">
					<view class="uni-input-text">维修部位照片：</view>
					<view class="imageStyle">
						<image src="/static/my/组 4.png" mode=""></image>
						<image src="/static/my/组 4.png" mode=""></image>
						<image src="/static/my/组 4.png" mode=""></image>
					</view>

				</view>
			</view>
			<view class="bottomBtn" @click="cancleRes">
				取消预约
			</view>

		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				formData: {
					mid: '1213234',
					status: '进行中',
					username: '张三',
					phone: '15645556456',
					method: '上门取车',
					carAddress: '山阳区32号',
					reservateTime: '2022-11-10 11：00',
					submitTime: '2022-11-08  12：34',
					type: "SUV",
					carId: "豫v985L0",
				}
			}
		},
		methods: {
			cancleRes() {
				uni.showModal({
					title: '确认取消预约',
					content: '您确定取消预约吗？',
					success: (res) => {
						if (res.confirm) {
							// 用户点击了确定
							this.handleConfirm();
						} else if (res.cancel) {
							// 用户点击了取消
							this.handleCancel();
						}
					}
				});
			},
			handleConfirm() {
				console.log('确认');
				// 在这里执行确认后的操作
				uni.navigateTo({
					url: "/pages/maintenance/nearStore/storeDetail/reservation/reservation"
				})
			},
			handleCancel() {
				console.log('取消');
			},

		}
	}
</script>

<style>
	.top {
		width: 100%;
		height: 350rpx;
		background-color: #1E90FF;
		position: fixed;
	}

	.formBox {
		width: 90%;
		left: 0;
		right: 0;
		margin: auto;
		height: 1300rpx;
		display: flex;
		flex-direction: column;
		background-color: #F5F5F5;
		position: absolute;
		z-index: 1;
		border-radius: 30rpx;
	}

	.infoFlex {
		width: 100%;
		height: 54rpx;
		display: flex;
		justify-content: space-around;
		margin-top: 25rpx;
		background-color: white;

	}

	.maintenanceInfo {
		width: 90%;
		padding: 0 5% 0 5%;
		height: auto;
		background-color: white;
		padding-bottom: 20rpx;
		border-radius: 30rpx;
	}

	.carInfo {
		width: 90%;
		padding: 0 5% 0 5%;
		height: auto;
		background-color: white;
		padding-bottom: 60rpx;
		margin: 20rpx auto;
		border-radius: 30rpx;
	}

	.maintenanceInfo .text,
	.carInfo .text {
		width: 94%;
		height: 80rpx;
		background-color: white;
		margin: 10rpx auto;
		padding: 0 10rpx 0 5rpx;
		line-height: 80rpx;
		border-bottom: 2px solid #F5F5F5;
	}

	.infoFlex>view {
		width: 30%;
		background-color: white;
		color: #000000;
		text-align: left;
		border-radius: 35rpx;
		font-size: 12px;
		height: 74rpx;
		line-height: 74rpx;
	}

	.infoFlex view:nth-last-child(1) {
		width: 60%;
		color: #C0C0C0;
		text-align: right;
	}

	.picture {
		width: 100%;
		height: auto;
		margin-top: 25rpx;
	}

	.picture>view {
		width: 100%;
		background-color: white;
		color: #000000;
		text-align: left;
		font-size: 12px;

	}

	.picture view:nth-child(1) {
		margin-left: 20rpx;
	}

	.imageStyle {
		width: 50rpx;
		background-color: aqua;
		height: 50rpx;
	}


	image {
		width: 100rpx;
		height: 100rpx;
		margin-left: 20rpx;

	}

	.bottomBtn {
		width: 70%;
		height: 60rpx;
		line-height: 60rpx;
		text-align: center;
		color: #fff;
		border-radius: 30rpx;
		background-color: #1E90FF;
		margin-bottom: 20rpx;
		margin: 30rpx auto;
		margin-bottom: 20rpx;

	}
</style>